package yazan.com.pdacollector_android.model;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.JoinProperty;
import org.greenrobot.greendao.annotation.ToMany;
import org.greenrobot.greendao.annotation.Transient;

import java.util.Date;
import java.util.List;

@Entity
public class OrderInfo {
    @Transient
    private boolean Flag;
    @Transient
    private String Message;
//    @ToMany(referencedJoinProperty = "Forder_id")
    @ToMany(joinProperties = {
            @JoinProperty(name = "Forder_id",referencedName = "Forder_id")
            })
    public List<Goods> Data;
    private int Amount;
    @Id
    private long Forder_id;
    private String Forder_sn;
    private int validation_type;
    private Date Forder_date;
    private Date Fexa_date;
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 2087209612)
    private transient OrderInfoDao myDao;
    @Generated(hash = 2088403398)
    public OrderInfo(int Amount, long Forder_id, String Forder_sn,
            int validation_type, Date Forder_date, Date Fexa_date) {
        this.Amount = Amount;
        this.Forder_id = Forder_id;
        this.Forder_sn = Forder_sn;
        this.validation_type = validation_type;
        this.Forder_date = Forder_date;
        this.Fexa_date = Fexa_date;
    }
    @Generated(hash = 1695813404)
    public OrderInfo() {
    }
    public int getAmount() {
        return this.Amount;
    }
    public void setAmount(int Amount) {
        this.Amount = Amount;
    }
    public long getForder_id() {
        return this.Forder_id;
    }
    public void setForder_id(long Forder_id) {
        this.Forder_id = Forder_id;
    }
    public String getForder_sn() {
        return this.Forder_sn;
    }
    public void setForder_sn(String Forder_sn) {
        this.Forder_sn = Forder_sn;
    }
    public int getValidation_type() {
        return this.validation_type;
    }
    public void setValidation_type(int validation_type) {
        this.validation_type = validation_type;
    }
    public Date getForder_date() {
        return this.Forder_date;
    }
    public void setForder_date(Date Forder_date) {
        this.Forder_date = Forder_date;
    }
    public Date getFexa_date() {
        return this.Fexa_date;
    }
    public void setFexa_date(Date Fexa_date) {
        this.Fexa_date = Fexa_date;
    }

    public String getMessage() {
        return Message;
    }

    public void setMessage(String message) {
        Message = message;
    }

    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Generated(hash = 95776327)
    public List<Goods> getData() {
        if (Data == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            GoodsDao targetDao = daoSession.getGoodsDao();
            List<Goods> DataNew = targetDao._queryOrderInfo_Data(Forder_id);
            synchronized (this) {
                if (Data == null) {
                    Data = DataNew;
                }
            }
        }
        return Data;
    }
    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Generated(hash = 1723753803)
    public synchronized void resetData() {
        Data = null;
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1732476797)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getOrderInfoDao() : null;
    }
    
    
}
